import * as CryptoES from 'crypto-es';

/**
 * @word 要加密的内容
 * @keyWord String  服务器随机返回的关键字
 *  */
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") {
    let key = CryptoES.enc.Utf8.parse(keyWord);
    let srcs = CryptoES.enc.Utf8.parse(word);
    let encrypted = CryptoES.AES.encrypt(srcs, key, {mode: CryptoES.mode.ECB, padding: CryptoES.pad.Pkcs7});
    return encrypted.toString();
}
